<template>
  <div id="app">
    <!-- 公有组件,放在全局 -->
    <Topbar />
    <Header />
    <router-view />
    <Footer />
  </div>
</template>
<script>
// 引入axios
// import axios from 'axios'
import { JingpinAPI } from "@/request/api";

import Header from "@/components/Header.vue";
import Topbar from "@/components/Topbar.vue";
import Footer from "@/components/Footer.vue";

export default {
  components: {
    Header,
    Topbar,
    Footer,
  },
  created() {
    // axios
    //   .get("/products/recommend")
    //   .then((res) => {
    //     console.log(res);
    //   })
    //   .catch((err) => {
    //     console.log(err);
    //   });

    // scr-->rerquest --> request.js  (创建axios实例)
    // 统一接口代码  scr-->rerquest --> api.js

    JingpinAPI()
      .then((res) => {
        console.log(res);
      })
      .catch((err) => {
        console.log(err);
      });
  },
};
</script>

<style lang="less">
// #app {
//   font-family: Avenir, Helvetica, Arial, sans-serif;
//   -webkit-font-smoothing: antialiased;
//   -moz-osx-font-smoothing: grayscale;
//   text-align: center;
//   color: #2c3e50;
// }
</style>
